package com.zhixi.common;

/**
 * @ClassName SharedVariablesCurrent
 * @Author zhangzhixi
 * @Description 共享ThreadLocal变量
 * @Date 2022-7-10 11:04
 * @Version 1.0
 */
public class SharedVariablesCurrent {

    private SharedVariablesCurrent() {

    }

    /**
     * 线程共享的变量
     */
    private static final ThreadLocal<Long> CURRENT = new ThreadLocal<>();

    public static void setCurrent(Long id) {
        CURRENT.set(id);
    }

    public static Long getCurrent() {
        return CURRENT.get();
    }

    public static void removeCurrent() {
        CURRENT.remove();
    }
}
